package com.xbongbong.parent.interfaces;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.pojo.dto.FormDataUpdateDTO;
import com.xbongbong.paas.pojo.vo.FormDataUpdateVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.formdata.pojo.vo.BeforeUpdateVO;
import com.xbongbong.pro.formdata.pojo.vo.UpdateVO;

/**
 * 工作流编辑用相关接口
 * @author 魏荣杰
 *
 */
public interface FormDataUpdateWorkflowService<F, D> {

    /**
     * Description: 保存（工作流用）
     * @param formDataUpdateDTO
     * @param beforeUpdateVO
     * @return com.xbongbong.pro.formdata.pojo.vo.UpdateVO
     * @throws
     * @author 魏荣杰
     * @date 2021/6/21 14:19
     * @since
     */
    UpdateVO updateForWorkflow(FormDataUpdateDTO formDataUpdateDTO, BeforeUpdateVO beforeUpdateVO, F paasFormEntity, D paasFormDataEntity, D oldPaasFormDataEntity) throws XbbException;

    /**
     * Description: 保存后操作（工作流用）
     * @param formDataUpdateDTO
     * @param beforeUpdateVO
     * @param updateVO
     * @return com.xbongbong.paas.pojo.vo.FormDataUpdateVO
     * @throws
     * @author 魏荣杰
     * @date 2021/6/21 14:21
     * @since
     */
    FormDataUpdateVO afterSaveForWorkflow(FormDataUpdateDTO formDataUpdateDTO, BeforeUpdateVO beforeUpdateVO, UpdateVO updateVO, F paasFormEntity, D paasFormDataEntity, D oldPaasFormDataEntity) throws XbbException;

    /**
     * 备份
     * @param formDataUpdateDTO
     * @param beforeUpdateVO
     * @return
     * @throws XbbException
     */
    Long backupData(FormDataUpdateDTO formDataUpdateDTO, BeforeUpdateVO beforeUpdateVO, F paasFormEntity, D paasFormDataEntity, D oldPaasFormDataEntity) throws XbbException;

    /**
     * Description: 备份各业务特殊逻辑,编辑进审批数据备份追加信息补充
     * @param data
	 * @param corpid
	 * @param dataId
     * @return com.alibaba.fastjson.JSONObject
     * @throws
     * @author 魏荣杰
     * @date 2022/9/29 13:38
     * @since
     */
    JSONObject backupDataOtherInfo(JSONObject data, String corpid, Long dataId);
}
